<!--#layout("/common/layout.html",{"jsBase":"/js/stat/finTrans/"}){ -->
<div class="layui-row">
    <form id="searchForm" class="layui-form layui-form-pane">
        <div class="layui-collapse" lay-filter="condictionCol">
            <div class="layui-colla-item">
                <div class="layui-colla-content layui-show">

                    <div class="layui-row">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <div class="layui-input-inline layui-hide" style="width:125px">
                                    <input type="checkbox" lay-filter="byDay" name="byDay" lay-skin="switch"
                                           lay-text="单日统计|多日统计"/>
                                </div>
                                <label class="layui-form-label">选择日期</label>
                                <div class="layui-input-inline">
                                    <div class="date-range-pick">
                                        <input type="text" name="rangeDateQuery" autocomplete="off" class="layui-input"
                                               value="${startDate} ~ ${endDate}">
                                    </div>
                                </div>
                                <label class="layui-form-label" >包含退款</label>
                                <div class="layui-input-inline" >
                                    <select  class="select" name="refundFlag">
                                        <option value="">请选择</option>
                                        <option value="1" ${refundFlag==1?'selected':''}>包含</option>
                                        <option value="0" ${refundFlag==0?'selected':''}>不包含</option>
                                    </select>
                                </div>
                                <!--# if(accessType==6){ -->

                                    <label class="layui-form-label">所属租户</label>
                                    <layui:simpleDataSelect name="tenantId" data="${tenantList}"
                                                            attrId="tenantId" attrName="tenantName" laySearch="true"/>

                                <!--# } -->

                                <input  style="float: right;" class="layui-btn layui-btn-normal"  type="submit" value="搜索">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<!--#for(productItem in productList) {
    headList = productItem.headList;
    dataList = productItem.statList;
    var cCountTotal = {};
    var cMoneyTotal = {};
-->

<table class="layui-table" style="width:auto" lay-size="lg" lay-even>
    <colgroup>
        <col width="100px">
        <!--#for(headItem in headList) {
            cCountTotal[headItem] = 0;
            cMoneyTotal[headItem] = 0;
        -->
        <col width="70px">
        <col width="70px">
        <!--#}
            var cCountTotal1 = 0;
            var cMoneyTotal1 = 0;
        -->
        <col width="70px">
        <col width="70px">
    </colgroup>
    <thead>
    <tr>
        <th colspan="${productItem.headSize*2+3}" style="background-color: white;font-size: 18px">
            ${productItem.productName}
        </th>
    </tr>
    <tr>
        <th rowspan="2">日期</th>
        <!--#for(headItem in headList) {-->
        <th colspan="2">${headItem!"未名"}</th>
        <!--#} -->
        <th colspan="2">合计</th>
    </tr>
    <tr>
        <!--#for(headItem in headList) {-->
        <th>数量</th>
        <th>金额</th>
        <!--#} -->
        <th>数量</th>
        <th>金额</th>
    </tr>
    </thead>
    <tbody>
    <!--#for(dataItem in dataList) {
        var vTotalCount = 0;
        var vTotalMoney = 0;
    -->
    <tr>
        <td style="word-break: keep-all">${dataItem["payDate"]}</td>
        <!--#for(headItem in headList) {
                channel = dataItem[headItem];
                vTotalCount = vTotalCount+channel["totalCount"]!0;
                vTotalMoney = vTotalMoney+(channel["totalMoney"]!0)/100;
                cCountTotal[headItem] = cCountTotal[headItem]+channel["totalCount"]!0;
                cMoneyTotal[headItem] = cMoneyTotal[headItem]+(channel["totalMoney"]!0)/100;
        -->
        <td>${channel["totalCount"]!0}</td>
        <td>${(channel["totalMoney"]!0)/100,numberFormat="##.##"}</td>
        <!--#}
        cCountTotal1 = cCountTotal1+vTotalCount;
        cMoneyTotal1 = cMoneyTotal1+vTotalMoney;
        -->
        <td>${vTotalCount}</td>
        <td>${vTotalMoney}</td>
    </tr>
    <!--#} -->
    <tr>
        <td>合计</td>
        <!--#for(headItem in headList) {-->
        <td>${cCountTotal[headItem]}</td>
        <td>${cMoneyTotal[headItem]}</td>
        <!--#} -->
        <td>${cCountTotal1}</td>
        <td>${cMoneyTotal1}</td>
    </tr>
    </tbody>
</table>
<!--#} -->
<!--#} -->

<style type="text/css">
    td{
        white-space:nowrap;
        overflow:hidden;
        word-break:keep-all;
    }
</style>
<script>
    layui.use(['index'], function () {
        var index = layui.index;
        var accessType = ${accessType};
        if(accessType!=3&&accessType!=6){
            Common.info("请授权");
            return;
        }
        index.init();
    });
</script>
